﻿
Partial Class login
    Inherits System.Web.UI.Page

   
   
    Protected Sub Login1_LoggedIn(sender As Object, e As EventArgs) Handles Login1.LoggedIn
        Dim returnurl = Request.QueryString("ReturnURL")
        If String.IsNullOrEmpty(returnurl) Then
            returnurl = "~/"
        End If
        Response.Redirect(returnurl)
    End Sub

    Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
        'Dim errs As New CustomValidator
        'errs.IsValid = False
        'errs.ErrorMessage = Request.QueryString("ReturnUrl")
        'Page.Validators.Add(errs)
    End Sub

    Protected Sub Page_LoadComplete(sender As Object, e As EventArgs) Handles Me.LoadComplete
        If Request.QueryString("ReturnUrl") <> "" Then
            Dim err As New CustomValidator
            err.IsValid = False
            err.CssClass = "SuccessLogs"
            err.ErrorMessage = "Access Denied!"
            Page.Validators.Add(err)

        End If

    End Sub

End Class
